# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Compute.V1.Model.InstanceGroupManagerResizeRequest do
  @moduledoc """
  InstanceGroupManagerResizeRequest represents a request to create a number of VMs: either immediately or by queuing the request for the specified time. This resize request is nested under InstanceGroupManager and the VMs created by this request are added to the owning InstanceGroupManager.

  ## Attributes

  *   `creationTimestamp` (*type:* `String.t`, *default:* `nil`) - [Output Only] The creation timestamp for this resize request in RFC3339 text format.
  *   `description` (*type:* `String.t`, *default:* `nil`) - An optional description of this resource.
  *   `id` (*type:* `String.t`, *default:* `nil`) - [Output Only] A unique identifier for this resource type. The server generates this identifier.
  *   `kind` (*type:* `String.t`, *default:* `compute#instanceGroupManagerResizeRequest`) - [Output Only] The resource type, which is always compute#instanceGroupManagerResizeRequest for resize requests.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The name of this resize request. The name must be 1-63 characters long, and comply with RFC1035.
  *   `requestedRunDuration` (*type:* `GoogleApi.Compute.V1.Model.Duration.t`, *default:* `nil`) - Requested run duration for instances that will be created by this request. At the end of the run duration instance will be deleted.
  *   `resizeBy` (*type:* `integer()`, *default:* `nil`) - The number of instances to be created by this resize request. The group's target size will be increased by this number. This field cannot be used together with 'instances'.
  *   `selfLink` (*type:* `String.t`, *default:* `nil`) - [Output Only] The URL for this resize request. The server defines this URL.
  *   `selfLinkWithId` (*type:* `String.t`, *default:* `nil`) - [Output Only] Server-defined URL for this resource with the resource id.
  *   `state` (*type:* `String.t`, *default:* `nil`) - [Output only] Current state of the request.
  *   `status` (*type:* `GoogleApi.Compute.V1.Model.InstanceGroupManagerResizeRequestStatus.t`, *default:* `nil`) - [Output only] Status of the request.
  *   `zone` (*type:* `String.t`, *default:* `nil`) - [Output Only] The URL of a zone where the resize request is located. Populated only for zonal resize requests.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :creationTimestamp => String.t() | nil,
          :description => String.t() | nil,
          :id => String.t() | nil,
          :kind => String.t() | nil,
          :name => String.t() | nil,
          :requestedRunDuration => GoogleApi.Compute.V1.Model.Duration.t() | nil,
          :resizeBy => integer() | nil,
          :selfLink => String.t() | nil,
          :selfLinkWithId => String.t() | nil,
          :state => String.t() | nil,
          :status => GoogleApi.Compute.V1.Model.InstanceGroupManagerResizeRequestStatus.t() | nil,
          :zone => String.t() | nil
        }

  field(:creationTimestamp)
  field(:description)
  field(:id)
  field(:kind)
  field(:name)
  field(:requestedRunDuration, as: GoogleApi.Compute.V1.Model.Duration)
  field(:resizeBy)
  field(:selfLink)
  field(:selfLinkWithId)
  field(:state)
  field(:status, as: GoogleApi.Compute.V1.Model.InstanceGroupManagerResizeRequestStatus)
  field(:zone)
end

defimpl Poison.Decoder, for: GoogleApi.Compute.V1.Model.InstanceGroupManagerResizeRequest do
  def decode(value, options) do
    GoogleApi.Compute.V1.Model.InstanceGroupManagerResizeRequest.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Compute.V1.Model.InstanceGroupManagerResizeRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
